package com.mc.lp.view.controllers;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.mc.lifepals.database.service.impl.UserServiceImpl;
import com.mc.lp.view.constants.IConstants;

/**
 * @author: deepak.verma
 * @description: class to act as controller for user or parent section pages.
 * */
@Controller
public class UserViewController implements IConstants {
	
	@RequestMapping(value = PAGES.USER_WELCOME, method = RequestMethod.GET)
	public ModelAndView adminPage() {
		System.out.println("TESTING USER BEAN" + getUserService().getAll());
		ModelAndView model = new ModelAndView();
		model.addObject("title", "Welcome To Microcampus");
		model.addObject("message", "This is protected page!");
		model.setViewName(PAGES.USER_WELCOME);
		return model;
	}
	
	@Resource
	UserServiceImpl userService;
	public UserServiceImpl getUserService() {
		return userService;
	}
	public void setUserService(UserServiceImpl userService) {
		this.userService = userService;
	}
}
